package q1290_getDecimalValue;

import CommonClass.ListNode;

public class Solution {
    /*
    位运算简单解决
     */
    public int getDecimalValue(ListNode head) {
        int ans = 0;
        while (head != null) {
            ans = (ans << 1) | head.val;
            head = head.next;
        }
        return ans;
    }
}
